<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StakeholderPortalTemplate.xhtml">

    <link href="./../resources/css/default.css" rel="stylesheet" type="text/css" />
    <link href="./../resources/css/tableLayout.css" rel="stylesheet" type="text/css" />
    <h:head>
        <title>My Outbox</title>
    </h:head>
    <ui:define name="left">

    </ui:define>

    <ui:define name="content">
        <f:view beforePhase="#{viewOutboxManagedBean.initView}">

            <p:panel header="Sent Items">
                <p:messages id="statusMessages" redisplay="true" />
                <h:panelGrid columns="1" cellpadding="1" >

                    <h:outputText id="resultList" value="Total send items: #{viewOutboxManagedBean.messageList.size()}" 
                                  style="font-size: 10px; color: red; float: right;"/>

                    <p:dataTable id="adListTable" var="message" 
                                 rendered="true" value="#{viewOutboxManagedBean.messageList}"
                                 style="width:850px;">

                        <p:column filterBy="#{message.receiver}" style="width: 20%">  
                            <f:facet name="header">  
                                To:
                            </f:facet>  
                            <h:outputText value="#{message.receiver}" style="font-weight: bold"/>

                        </p:column> 

                        <p:column filterBy="#{message.subject}" style="width: 45%">  
                            <f:facet name="header">  
                                Subject
                            </f:facet> 
                            <h:commandLink value="#{message.subject}"
                                           actionListener="#{viewOutboxManagedBean.view_Message(message)}"/>
                        </p:column> 

                        <p:column>  
                            <f:facet name="header">  
                                Date Sent
                            </f:facet>  
                            <h:outputText value="#{message.msgDate}">
                                <f:convertDateTime dateStyle="long" type="both"/>
                            </h:outputText>
                        </p:column> 
                    </p:dataTable>    
                </h:panelGrid>
            </p:panel>
        </f:view>
    </ui:define>
</ui:composition>
